<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui">
<h:head>
	<link href="../../css/component.css" rel="stylesheet" type="text/css" />
</h:head>

<ui:param name="bean" value="#{flowQueryConfigAction}" />
<h:body>
	<h:form id="fsearch">
		<p:growl id="growl" showDetail="true" sticky="true" />
		
		<p:panel id="panel1" header="添加" style="margin-bottom:10px;">
			<p:dataTable id="dlist" var="l" value="#{bean.entity}" resizableColumns="true" paginator="false" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
				<p:column headerText="编号（排序）" styleClass="column">
					<h:inputText value="#{l.sequence}" />
				</p:column>
				<p:column headerText="查询名称" styleClass="column">
					<h:inputText value="#{l.name}" />
				</p:column>
				<p:column headerText="表名" styleClass="column">
					<h:inputText value="#{l.tableName}" />
				</p:column>
				<p:column headerText="排序语句" styleClass="column">
					<h:inputText value="#{l.sortStr}" />
				</p:column>
				<p:column headerText="描述" styleClass="column">
					<h:inputText value="#{l.desc}" />
				</p:column>
				
				<p:column headerText="操作" styleClass="column">
					<p:commandButton value="添加" action="#{bean.add()}" update=":data" ajax="false" />
				</p:column>
			</p:dataTable>
   		</p:panel>
	</h:form>
	<br />

	<h:form id="dform">
		<div class="data" id="data">
			<p:panel id="panel1" header="结果展示" style="margin-bottom:10px;">
				<p:dataTable id="dlist" var="l" value="#{bean.list}" resizableColumns="true" paginator="true" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
					<p:column headerText="编号（排序）" styleClass="column">
						<h:inputText value="#{l.sequence}" />
					</p:column>
					<p:column headerText="查询名称" styleClass="column">
						<h:inputText value="#{l.name}" />
					</p:column>
					<p:column headerText="表名" styleClass="column">
						<h:inputText value="#{l.tableName}" />
					</p:column>
					<p:column headerText="排序语句" styleClass="column">
						<h:inputText value="#{l.sortStr}" />
					</p:column>
					<p:column headerText="描述" styleClass="column">
						<h:inputText value="#{l.desc}" />
					</p:column>
					<p:column headerText="操作" styleClass="column">
						<p:commandButton value="修改" action="#{bean.modify(l)}" update=":data" ajax="false" />
						<p:commandButton value="删除" action="#{bean.delete(l.id)}" update=":data" ajax="false" />
					</p:column>
					<p:column headerText="配置" styleClass="column">
						<p:commandButton update=":dform:config" oncomplete="PF('configPanel').show('#{component.clientId}')" icon="ui-icon-config" title="配置">
			                <f:setPropertyActionListener value="#{l}" target="#{bean.selectedConfig}" />
			            </p:commandButton>
					</p:column>
				</p:dataTable>
				
				<p:overlayPanel widgetVar="configPanel" showEffect="fade" hideEffect="fade" dismissable="false" showCloseIcon="true">
			        <p:outputPanel id="config" style="text-align:center;">
			            <p:panelGrid  columns="1" >
			                <h:outputText value="Id:" />
			            </p:panelGrid>
			        </p:outputPanel>
			    </p:overlayPanel>
	   		</p:panel>
   		</div>
	</h:form>
</h:body>
</html>
